<template>
  <u-navbar title="我的奖励" bg-color="unset" auto-back left-icon-color="#fff" :titleStyle="{color:'#fff'}"
    placeholder></u-navbar>
  <image src="@/static/images/04_ws.png" class="banner-img" mode=""></image>
  <view class="u-flex-y-center u-flex-between wallet-box u-m-t-40">
    <view style="width: 180;">
      <u-text :text="wallet.money" align="center" color="#fff" size="28"></u-text>
      <u-text text="当前可用余额" color="#fff" size="13"></u-text>
    </view>
    <view class="wallet-btn" @click="$u.route('/pages/houseMine/walletWithdrawal')">提现</view>
  </view>
  <view class="waller-title">
    <image src="@/static/images/04_29fg.png" mode=""></image>
    <text>余额明细</text>
  </view>
  <block v-for="item in list" :key="item.id">
    <integral-item :item="item" />
  </block>
  <u-empty mode="list"></u-empty>
</template>

<script setup>
  import { onMounted, ref } from 'vue';
  import integralItem from '../index/components/integral-item.vue'
  import { money, money_record } from '../../config/api';
  const wallet = ref({})
  const list = ref([])
  onMounted(() => {
    _money()
    _money_record()
  })
  // 余额明细
  const _money_record = () => {
    money_record().then(res => {
      list.value = res.data
    })
  }
  // 我的钱包
  const _money = () => {
    money().then(res => {
      wallet.value = res.data
    })
  }
</script>

<style lang="scss" scoped>
  .banner-img {
    position: absolute;
    top: 0;
    left: 0;
    height: 398rpx;
    width: 100%;
  }

  .wallet-box {
    padding-left: 172rpx;
    padding-right: 80rpx;
    position: relative;
    z-index: 1;

    .wallet-btn {
      width: 136rpx;
      height: 56rpx;
      background: #FFFFFF;
      border-radius: 28rpx;
      border: 1rpx solid #FFFFFF;
      line-height: 56rpx;
      text-align: center;
      font-size: 28rpx;
      font-weight: 500;
      color: #F87610;
    }
  }

  .waller-title {
    font-size: 32rpx;
    font-weight: 800;
    color: #000;
    position: relative;
    text-align: center;
    margin-top: 90rpx;

    image {
      width: 460rpx;
      height: 6rpx;
      position: absolute;
      left: 0;
      right: 0;
      top: 0;
      bottom: 0;
      margin: auto;
    }
  }
</style>